<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								活动ID：<input type="text" name="actId"/>
							</li>

							<li>
								抽奖人openid：<input type="text" name="openid"/>
							</li>

							<li>
								昵称：<input type="text" name="nickname"/>
							</li>

							<li>
								奖项：<input type="text" name="awardsId"/>
							</li>

							<li>
								是否中奖：’0‘:否；’1‘:是：<input type="text" name="awardStatus"/>
							</li>

							<li>
								兑奖码：<input type="text" name="awardCode"/>
							</li>

							<li>
								领奖状态：‘0’：未领取；‘1’：已领取：<input type="text" name="recieveStatus"/>
							</li>

							<li>
								领奖时间：<input type="text" name="recieveTime"/>
							</li>

							<li>
								抽奖时间：<input type="text" name="awardTime"/>
							</li>

							<li>
								收货人姓名：<input type="text" name="realname"/>
							</li>

							<li>
								收货人手机号：<input type="text" name="phone"/>
							</li>

							<li>
								收货人地址：<input type="text" name="address"/>
							</li>

							<li>
								抽奖序号：<input type="text" name="seq"/>
							</li>

							<li>
								公众号原始id：<input type="text" name="jwid"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
				<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="jiugongge:jiugonggeRecord:add">
					<i class="fa fa-plus"></i> 添加
				</a>
				<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="jiugongge:jiugonggeRecord:edit">
					<i class="fa fa-edit"></i> 修改
				</a>
				<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="jiugongge:jiugonggeRecord:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
				<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="jiugongge:jiugonggeRecord:export">
						<i class="fa fa-download"></i> 导出
				 </a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('jiugongge:jiugonggeRecord:edit')}]];
        var removeFlag = [[${@permission.hasPermi('jiugongge:jiugonggeRecord:remove')}]];
        var prefix = ctx + "jiugongge/jiugonggeRecord";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
				exportUrl: prefix + "/export",
                modalName: "九宫格抽奖记录",
				search: false,
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'id', 
					title : 'ID',
					visible: false
				},
				{
					field : 'actId', 
					title : '活动ID',
					sortable: true
				},
				{
					field : 'openid', 
					title : '抽奖人openid',
					sortable: true
				},
				{
					field : 'nickname', 
					title : '昵称',
					sortable: true
				},
				{
					field : 'awardsId', 
					title : '奖项',
					sortable: true
				},
				{
					field : 'awardStatus', 
					title : '是否中奖：’0‘:否；’1‘:是',
					sortable: true
				},
				{
					field : 'awardCode', 
					title : '兑奖码',
					sortable: true
				},
				{
					field : 'recieveStatus', 
					title : '领奖状态：‘0’：未领取；‘1’：已领取',
					sortable: true
				},
				{
					field : 'recieveTime', 
					title : '领奖时间',
					sortable: true
				},
				{
					field : 'awardTime', 
					title : '抽奖时间',
					sortable: true
				},
				{
					field : 'realname', 
					title : '收货人姓名',
					sortable: true
				},
				{
					field : 'phone', 
					title : '收货人手机号',
					sortable: true
				},
				{
					field : 'address', 
					title : '收货人地址',
					sortable: true
				},
				{
					field : 'seq', 
					title : '抽奖序号',
					sortable: true
				},
				{
					field : 'jwid', 
					title : '公众号原始id',
					sortable: true
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>